package com.phuc.app.vuivui.sqlite;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;

/**
 * Sqlite DB adapter class.
 *
 */
public class DatabaseAdapter {

	static Context context;
	
	/**
	 * 
	 */
	private static SqliteHelper helper;
	
	public static void initHelper(Context context) {
		helper = new SqliteHelper(context);
		DatabaseAdapter.context = context;
	}
	
	public static SQLiteDatabase open() {
		if (helper == null) {
			helper = new SqliteHelper(context);
		}
		return helper.getWritableDatabase();
	}
	
	public static void close() {
		helper.close();
	}

}
